import type {FormSchema} from '@/components/core/schema-form';
export const eventSchemas = (): FormSchema<API.EventUpEntity>[] => [
    {
        field: 'eventType',
        component: 'RadioGroup',
        label: '事件类型',
        defaultValue: 0,
        componentProps: {
            options: [
                {
                    label: '帮办',
                    value: 0,
                },
                {
                    label: '代办',
                    value: 1,
                },
            ],
        },
        dynamicDisabled: true,
    },
    {
        field: 'eventStatus',
        component: 'RadioGroup',
        label: '事件状态',
        defaultValue: 0,
        componentProps: {
            options: [
                {
                    label: '未处理',
                    value: 0,
                },
                {
                    label: '处置中',
                    value: 1,
                },
                {
                    label: '已办结',
                    value: 2,
                },
                {
                    label: '驳回中',
                    value: 3,
                },
            ],
        },
        dynamicDisabled: true,
    },
    {
        field: 'itemName',
        component: 'Input',
        label: '事项名称',
        rules: [{required: false, type: 'string'}],
        dynamicDisabled: true,
    },
    {
        field: 'reportingLocation',
        component: 'Input',
        label: '上报地点',
        rules: [{required: false, type: 'string'}],
        dynamicDisabled: true,
    },
    // {
    //     field: 'reportingLocation',
    //     component: 'Input',
    //     label: '上报地点',
    //     rules: [{required: false, type: 'string'}],
    //     dynamicDisabled: true,
    // },
    {
        field: 'upPerson',
        component: 'Input',
        label: '上报人名',
        rules: [{required: false, type: 'string'}],
        dynamicDisabled: true,
    },
    {
        field: 'eventContent',
        component: 'InputTextArea',
        label: '上报内容',
        rules: [{required: false, type: 'string'}],
        dynamicDisabled: true,
    },
    {
        field: 'upTime',
        component: 'Input',
        label: '上报时间',
        dynamicDisabled: true,
    },
    {
        field: 'distractorWpsUser',
        component: 'Input',
        label: '分派人名称',
        dynamicDisabled: true,
        componentProps: () => {
            return {
                placeholder: '暂未分派'
            }
        }
    },
    {
        field: 'distractorToWpsUser',
        component: 'Input',
        label: '被分派人',
        dynamicDisabled: true,
        componentProps: () => {
            return {
                placeholder: '暂未分派'
            }
        }
    },
    {
        field: 'distractorTime',
        component: 'Input',
        label: '分派时间',
        dynamicDisabled: true,
        componentProps: () => {
            return {
                placeholder: '暂未分派'
            }
        }
    },
    {
        field: 'endWpsUser',
        component: 'Input',
        label: '事件处置人',
        dynamicDisabled: true,
        componentProps: () => {
            return {
                placeholder: '暂未办结'
            }
        }
    },
    {
        field: 'endEventTime',
        component: 'Input',
        label: '事件结束时间',
        dynamicDisabled: true,
        componentProps: () => {
            return {
                placeholder: '暂未办结'
            }
        }
    },
    {
        field: 'upPersonPhone',
        component: 'Input',
        label: '上报人手机号',
        dynamicDisabled: true,
        componentProps: () => {
            return {
                placeholder: '暂未上报'
            }
        }
    },
    {
        field: 'rejectPerson',
        component: 'Input',
        label: '驳回人',
        dynamicDisabled: true,
        componentProps: () => {
            return {
                placeholder: '暂未驳回'
            }
        }
    },
    {
        field: 'rejectTime',
        component: 'Input',
        label: '驳回时间',
        dynamicDisabled: true,
        componentProps: () => {
            return {
                placeholder: '暂未驳回'
            }
        }
    },
    {
        field: 'rejectOpinion',
        component: 'InputTextArea',
        label: '驳回意见',
        rules: [{required: false, type: 'string'}],
        dynamicDisabled: true,
        componentProps: () => {
            return {
                placeholder: '暂未驳回'
            }
        }
    },
    {
        field: 'disposalResult',
        component: 'InputTextArea',
        label: '处置结果',
        rules: [{required: false, type: 'string'}],
        dynamicDisabled: true,
        componentProps: () => {
            return {
                placeholder: '暂未上报'
            }
        }
    },
];


// const settle = (type: API.EventUpEntity['customButton']) => type === true;
// const assignment = (type: API.EventUpEntity['customButton']) => type === false;

export const eventSchemasHandlerFenpai = (): FormSchema<API.EventUpEntity>[] => [
    {
        field: 'eventid',
        component: 'Input',
        label: '事件ID',
        rules: [{required: false, type: 'string'}],
        vShow: false,
        dynamicDisabled: true,
    },
    {
        field: 'eventStatus',
        component: 'RadioGroup',
        label: '事件状态',
        defaultValue: 0,
        componentProps: {
            options: [
                {
                    label: '未处理',
                    value: 0,
                },
                {
                    label: '处置中',
                    value: 1,
                },
                {
                    label: '已办结',
                    value: 2,
                },
                {
                    label: '驳回中',
                    value: 3,
                }
            ],
        },
        dynamicDisabled: true,
    },
    {
        field: 'upPerson',
        component: 'Input',
        label: '上报人名',
        rules: [{required: false, type: 'string'}],
        dynamicDisabled: true,
    },
    {
        field: 'eventContent',
        component: 'InputTextArea',
        label: '上报内容',
        rules: [{required: false, type: 'string'}],
        dynamicDisabled: true,
    },
    {
        field: 'customButton',
        component: 'RadioGroup',
        defaultValue: 1,
        componentProps: {
            optionType: 'button',
            buttonStyle: 'solid',
            options: [
                {label: '办结', value: 2,},
                {label: '分派', value: 1},
                {label: '驳回', value: 3}
            ],
        },
        vShow: false,
        dynamicDisabled: true,
    },
    {
        field: 'distractorToWpsUserId',
        component: 'Select',
        label: '事件处置人',
        rules: [{required: true, type: 'string'}],
        // vIf: ({formModel}) => assignment(formModel['customButton']),
    },

];

export const eventSchemasHandlerBanjie = (): FormSchema<API.EventUpEntity>[] => [
    {
        field: 'eventid',
        component: 'Input',
        label: '事件ID',
        rules: [{required: false, type: 'string'}],
        vShow: false,
        dynamicDisabled: true,
    },
    {
        field: 'eventStatus',
        component: 'RadioGroup',
        label: '事件状态',
        defaultValue: 0,
        componentProps: {
            options: [
                {
                    label: '未处理',
                    value: 0,
                },
                {
                    label: '处置中',
                    value: 1,
                },
                {
                    label: '已办结',
                    value: 2,
                },
                {
                    label: '驳回中',
                    value: 3,
                },
            ],
        },
        dynamicDisabled: true,
    },
    {
        field: 'upPerson',
        component: 'Input',
        label: '上报人名',
        rules: [{required: false, type: 'string'}],
        dynamicDisabled: true,
    },
    {
        field: 'eventContent',
        component: 'InputTextArea',
        label: '上报内容',
        rules: [{required: false, type: 'string'}],
        dynamicDisabled: true,
    },
    {
        field: 'customButton',
        component: 'RadioGroup',
        defaultValue: 2,
        componentProps: {
            optionType: 'button',
            buttonStyle: 'solid',
            options: [
                {label: '办结', value: 2,},
                {label: '分派', value: 1},
                {label: '驳回', value: 3}
            ],
        },
        vShow: false,
        dynamicDisabled: true,
    },
    {
        field: 'disposalResult',
        component: 'InputTextArea',
        label: '处置结果',
        rules: [{required: true, type: 'string'}],
        componentProps: () => {
            return {
                placeholder: '暂未输入'
            }
        }
    },

];

export const eventSchemasHandlerBohui = (): FormSchema<API.EventUpEntity>[] => [
    {
        field: 'eventid',
        component: 'Input',
        label: '事件ID',
        rules: [{required: false, type: 'string'}],
        vShow: false,
        dynamicDisabled: true,
    },
    {
        field: 'eventStatus',
        component: 'RadioGroup',
        label: '事件状态',
        defaultValue: 0,
        componentProps: {
            options: [
                {
                    label: '未处理',
                    value: 0,
                },
                {
                    label: '处置中',
                    value: 1,
                },
                {
                    label: '已办结',
                    value: 2,
                },
                {
                    label: '驳回中',
                    value: 3,
                },
            ],
        },
        dynamicDisabled: true,
    },
    {
        field: 'upPerson',
        component: 'Input',
        label: '上报人名',
        rules: [{required: false, type: 'string'}],
        dynamicDisabled: true,
    },
    {
        field: 'eventContent',
        component: 'InputTextArea',
        label: '上报内容',
        rules: [{required: false, type: 'string'}],
        dynamicDisabled: true,
    },
    {
        field: 'customButton',
        component: 'RadioGroup',
        defaultValue: 3,
        componentProps: {
            optionType: 'button',
            buttonStyle: 'solid',
            options: [
                {label: '办结', value: 2,},
                {label: '分派', value: 1},
                {label: '驳回', value: 3},
            ],
        },
        dynamicDisabled: true,
    },
    {
        field: 'rejectOpinion',
        component: 'InputTextArea',
        label: '驳回意见',
        rules: [{required: true, type: 'string'}],
        componentProps: () => {
            return {
                placeholder: '暂未输入'
            }
        }
    },

];